<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <title>layui在线调试</title>
    <link rel="stylesheet" href="../../layui/css/layui.css" media="all">
    <style>
        body{background: white;width: 100%}
        .color{ color: #1E9FFF!important;font-weight: bold}
        .select input{height: 35px!important;width: 200px}
        thead td{background: #3c8dbc!important;color: white}
    </style>
</head>
<body>
<!--<span class="layui-breadcrumb" style="margin-left: 10px;margin-top: 6px;display: block">-->
<!--<span class="color">学籍信息&nbsp;-&nbsp;单一查询</span>-->
<!--</span>-->
<fieldset class="layui-elem-field site-demo-button" style="margin-top: 10px;width: 100%">
    <legend style="font-size: 14px"><span class="color">选课计划</span></legend>
    <span class="add" style="color: blue;text-decoration: underline;cursor: pointer;margin-left: 20px;display: block;margin-top: 10px">新增</span>
    <table class="layui-table" lay-size="sm">
        <thead>
            <td>代号</td>
            <td>计划名称</td>
            <td>计划年度</td>
            <td>计划学期</td>
            <td>开始日期</td>
            <td>结束日期</td>
        </thead>
        <tr>
            <td>119</td>
            <td> <span class="info" style="color: blue;cursor: pointer;text-decoration: underline">2017/2018学年第二学期网络选课</span></td>
            <td>2017</td>
            <td>	第二学期</td>
            <td>	2017/12/12</td>
            <td>2018/7/1</td>
        </tr>
        <tr>
            <td>118</td>
            <td> <span class="info" style="color: blue;cursor: pointer;text-decoration: underline">2017/2018学年第一学期网络选课</span></td>
            <td>2017</td>
            <td>	第二学期</td>
            <td>		2017/6/19</td>
            <td>2017/12/10</td>
        </tr>
        <tr>
            <td>117</td>
            <td> <span class="info" style="color: blue;cursor: pointer;text-decoration: underline">	2016/2017学年第二学期网络选课</span></td>
            <td>2016</td>
            <td>	第二学期</td>
            <td>		2016/12/27</td>
            <td>	2017/6/7</td>
        </tr>
    </table>
</fieldset>
<div id="add" style="display: none;">
    <div class="layui-form select">
    <table class="layui-table">
        <tr>
            <td style="border: none">
                <div class="layui-inline">
                    <label class="layui-form-label" style="width:110px;">计划代号</label>
                    <div class="layui-input-inline" style="height: 30px">
                        <input type="text" class="layui-input" placeholder="请输入计划代号">
                    </div>
                </div>
            </td>
            <td style="border: none">
                <div class="layui-inline">
                    <label class="layui-form-label" style="width:110px;">计划标题</label>
                    <div class="layui-input-inline" style="height: 30px">
                        <input type="text" class="layui-input" placeholder="请输入计划标题">
                    </div>
                </div>
            </td>
            <td style="border: none">
                <div class="layui-inline">
                    <label class="layui-form-label" style="width:90px;">学年度</label>
                    <div class="layui-input-inline" style="height: 30px">
                        <select name="quiz">
                            <option value="">请选择</option>
                            <option value="1">2017</option>
                            <option value="2">2016</option>
                            <option value="2">2015</option>
                            <option value="2">2014</option>
                            <option value="2">2013</option>
                            <option value="2">2012</option>
                            <option value="2">2011</option>
                        </select>
                    </div>
                </div>
            </td>
        </tr>
        <tr>
            <td style="border: none">
                <div class="layui-inline">
                    <label class="layui-form-label" style="width:90px;">学期</label>
                    <div class="layui-input-inline" style="height: 30px">
                        <select name="quiz">
                            <option value="">请选择</option>
                            <option value="1">第一学期</option>
                            <option value="2">第二学期</option>
                        </select>
                    </div>
                </div>
            </td>
            <td style="border: none">
                <div class="layui-inline" style="margin-left: 10px">
                    <label class="layui-form-label">开始时间</label>
                    <div class="layui-input-inline" style="height: 30px">
                        <input type="text" class="layui-input" placeholder="2017-10-01">
                    </div>
                </div>
            </td>
            <td colspan="2" style="border: none">
                <div class="layui-inline" style="margin-left: 10px">
                    <label class="layui-form-label">结束时间</label>
                    <div class="layui-input-inline" style="height: 30px">
                        <input type="text" class="layui-input" placeholder="2017-11-01">
                    </div>
                </div>
            </td>
        </tr>
        <tr>
            <td style="border: none">
                <div class="layui-inline" style="margin-left: -20px">
                    <label class="layui-form-label" style="width:110px;">选课阶段</label>
                    <div class="layui-input-inline" style="height: 30px">
                        <input type="text" class="layui-input" placeholder="10">
                    </div>
                </div>
            </td>
            <td style="border: none">
                <div class="layui-inline" style="margin-left: 10px">
                    <label class="layui-form-label">上线人数</label>
                    <div class="layui-input-inline" style="height: 30px">
                        <input type="text" class="layui-input" readonly="true" value="11">
                    </div>
                </div>
            </td>
            <td colspan="2" style="border: none">
                <div class="layui-inline" style="margin-left: 10px">
                    <label class="layui-form-label">上线时间</label>
                    <div class="layui-input-inline" style="height: 30px">
                        <input type="text" class="layui-input" readonly="true" value="30">
                    </div>
                </div>
            </td>
        </tr>
        <tr>
            <td style="border: 0">
                <div class="layui-inline" style="margin-left: 10px">
                    <label class="layui-form-label">最近操作者</label>
                    <div class="layui-input-inline" style="height: 30px">
                        <input type="text" class="layui-input" readonly="true" value="admin">
                    </div>
                </div>
            </td>
            <td style="border: 0">
                <div class="layui-inline" style="margin-left: 10px">
                    <label class="layui-form-label">操作时间</label>
                    <div class="layui-input-inline" style="height: 30px">
                        <input type="text" class="layui-input" readonly="true" value="2016-10-10">
                    </div>
                </div>
            </td>
        </tr>
    </table>
    </div>
    <div class="layui-inline">
        <label class="layui-form-label" style="width:90px;">概述</label>
        <div class="layui-input-inline" style="height: 30px">
            <textarea style="width: 900px;height: 100px"></textarea>
        </div>
    </div>
    <div class="layui-inline" style="margin-top: 80px">
        <label class="layui-form-label" style="width:90px;">备注事项</label>
        <div class="layui-input-inline" style="height: 30px">
            <textarea style="width: 900px;height: 100px"></textarea>
        </div>
    </div>
    <div class="layui-inline" style="margin-top: 80px">
        <label class="layui-form-label" style="width:90px;">公布事项</label>
        <div class="layui-input-inline" style="height: 30px">
            <textarea style="width: 900px;height: 100px"></textarea>
        </div>

    </div>
    <div class="layui-input-inline" style="height: 30px;margin-left: 300px;margin-top: 80px">
        <button class="layui-btn layui-btn-sm layui-btn-normal">保存</button>
    </div>
</div>



<div id="info" style="display: none;">
    <div class="layui-form select">
        <table class="layui-table">
            <tr>
                <td style="border: none">
                    <div class="layui-inline">
                        <label class="layui-form-label" style="width:110px;">计划代号</label>
                        <div class="layui-input-inline" style="height: 30px">
                            <input type="text" class="layui-input" value="119">
                        </div>
                    </div>
                </td>
                <td style="border: none">
                    <div class="layui-inline">
                        <label class="layui-form-label" style="width:110px;">计划标题</label>
                        <div class="layui-input-inline" style="height: 30px">
                            <input type="text" class="layui-input" value="2017/2018学年第二学期网络选课">
                        </div>
                    </div>
                </td>
                <td style="border: none">
                    <div class="layui-inline">
                        <label class="layui-form-label" style="width:90px;">学年度</label>
                        <div class="layui-input-inline" style="height: 30px">
                            <select name="quiz">
                                <option value="1">2017</option>
                                <option value="">请选择</option>
                                <option value="2">2016</option>
                                <option value="2">2015</option>
                                <option value="2">2014</option>
                                <option value="2">2013</option>
                                <option value="2">2012</option>
                                <option value="2">2011</option>
                            </select>
                        </div>
                    </div>
                </td>
            </tr>
            <tr>
                <td style="border: none">
                    <div class="layui-inline">
                        <label class="layui-form-label" style="width:90px;">学期</label>
                        <div class="layui-input-inline" style="height: 30px">
                            <select name="quiz">
                                <option value="1">第一学期</option>
                                <option value="">请选择</option>
                                <option value="2">第二学期</option>
                            </select>
                        </div>
                    </div>
                </td>
                <td style="border: none">
                    <div class="layui-inline" style="margin-left: 10px">
                        <label class="layui-form-label">开始时间</label>
                        <div class="layui-input-inline" style="height: 30px">
                            <input type="text" class="layui-input" value="2017-10-01">
                        </div>
                    </div>
                </td>
                <td colspan="2" style="border: none">
                    <div class="layui-inline" style="margin-left: 10px">
                        <label class="layui-form-label">结束时间</label>
                        <div class="layui-input-inline" style="height: 30px">
                            <input type="text" class="layui-input" value="2017-11-01">
                        </div>
                    </div>
                </td>
            </tr>
            <tr>
                <td style="border: none">
                    <div class="layui-inline" style="margin-left: -20px">
                        <label class="layui-form-label" style="width:110px;">选课阶段</label>
                        <div class="layui-input-inline" style="height: 30px">
                            <input type="text" class="layui-input" value="10">
                        </div>
                    </div>
                </td>
                <td style="border: none">
                    <div class="layui-inline" style="margin-left: 10px">
                        <label class="layui-form-label">上线人数</label>
                        <div class="layui-input-inline" style="height: 30px">
                            <input type="text" class="layui-input" readonly="true" value="11">
                        </div>
                    </div>
                </td>
                <td colspan="2" style="border: none">
                    <div class="layui-inline" style="margin-left: 10px">
                        <label class="layui-form-label">上线时间</label>
                        <div class="layui-input-inline" style="height: 30px">
                            <input type="text" class="layui-input" readonly="true" value="30">
                        </div>
                    </div>
                </td>
            </tr>
            <tr>
                <td style="border: 0">
                    <div class="layui-inline" style="margin-left: 10px">
                        <label class="layui-form-label">最近操作者</label>
                        <div class="layui-input-inline" style="height: 30px">
                            <input type="text" class="layui-input" readonly="true" value="admin">
                        </div>
                    </div>
                </td>
                <td style="border: 0">
                    <div class="layui-inline" style="margin-left: 10px">
                        <label class="layui-form-label">操作时间</label>
                        <div class="layui-input-inline" style="height: 30px">
                            <input type="text" class="layui-input" readonly="true" value="2016-10-10">
                        </div>
                    </div>
                </td>
            </tr>
        </table>
    </div>
    <div class="layui-inline">
        <label class="layui-form-label" style="width:90px;">概述</label>
        <div class="layui-input-inline" style="height: 30px">
            <textarea style="width: 900px;height: 100px"></textarea>
        </div>
    </div>
    <div class="layui-inline" style="margin-top: 80px">
        <label class="layui-form-label" style="width:90px;">备注事项</label>
        <div class="layui-input-inline" style="height: 30px">
            <textarea style="width: 900px;height: 100px"></textarea>
        </div>
    </div>
    <div class="layui-inline" style="margin-top: 80px">
        <label class="layui-form-label" style="width:90px;">公布事项</label>
        <div class="layui-input-inline" style="height: 30px">
            <textarea style="width: 900px;height: 100px"></textarea>
        </div>

    </div>
    <div class="layui-input-inline" style="height: 30px;margin-left: 300px;margin-top: 80px">
        <button class="layui-btn layui-btn-sm layui-btn-normal">保存</button>
    </div>
</div>
<script src="../../layui/layui.js"></script>
<script src="../../layui/jquery-1.12.4.min.js"></script>
<script>
    layui.use('element',"laydate", function(){
        var element = layui.element; //导航的hover效果、二级菜单等功能，需要依赖element模块
        var laydate = layui.laydate;

        //常规用法
        laydate.render({
            elem: '#test1'
        });
        //监听导航点击
        element.on('nav(demo)', function(elem){
            //console.log(elem)
            layer.msg(elem.text());
        });
    });
</script>
<script>
    layui.use(['form', 'layedit', 'laydate'], function(){
        var form = layui.form
            ,layer = layui.layer
            ,layedit = layui.layedit
            ,laydate = layui.laydate;

        //日期
        laydate.render({
            elem: '#date'
        });
        laydate.render({
            elem: '#date1'
        });

        //创建一个编辑器
        var editIndex = layedit.build('LAY_demo_editor');

        //自定义验证规则
        form.verify({
            title: function(value){
                if(value.length < 5){
                    return '标题至少得5个字符啊';
                }
            }
            ,pass: [/(.+){6,12}$/, '密码必须6到12位']
            ,content: function(value){
                layedit.sync(editIndex);
            }
        });

        //监听指定开关
        form.on('switch(switchTest)', function(data){
            layer.msg('开关checked：'+ (this.checked ? 'true' : 'false'), {
                offset: '6px'
            });
            layer.tips('温馨提示：请注意开关状态的文字可以随意定义，而不仅仅是ON|OFF', data.othis)
        });

        //监听提交
        form.on('submit(demo1)', function(data){
            layer.alert(JSON.stringify(data.field), {
                title: '最终的提交信息'
            })
            return false;
        });


    });
</script>
<script>
    $(function () {
        $(".add").click(function () {
            layer.open({
                type: 1,
                title: '添加',
                area: ['100%', '100%;'],
                content: $('#add')
            });
        })


        $(".info").click(function () {
            layer.open({
                type: 1,
                title: '详情',
                area: ['100%', '100%;'],
                content: $('#info')
            });
        })
    })
</script>
</body>
</html>
